﻿using System;
using System.Collections.Generic;
using Allegro.Framework;

namespace Allegro.Mathlib
{
    public interface ITaskMap
    {
        /// <summary>
        /// List of VariableBinding for each variable in the EquationSet
        /// </summary>
        List<VariableBinding> VariableBindings { get; }
        
        /// <summary>
        /// True if the variable is mapped
        /// </summary>
        /// <param name="varId"></param>
        /// <returns></returns>
        bool HasVariable(string varId);
        
        /// <summary>
        /// Return the variable index.
        /// </summary>
        /// <param name="varId"></param>
        /// <returns></returns>
        int IndexForVariable(string varId);
        
        /// <summary>
        /// Access a VariableBinding by variable index 
        /// </summary>
        /// <param name="varIndex">0-based variable index</param>
        /// <returns>Variable binding</returns>
        VariableBinding this[int varIndex] { get; }
        
        /// <summary>
        /// Access a VariableBinding by the variable id
        /// </summary>
        /// <param name="varId">Variable id</param>
        /// <returns>Variable binding</returns>
        VariableBinding this[string varId] { get; }
        
        /// <summary>
        /// Add variable binding
        /// </summary>
        /// <param name="varBinding">Variable binding</param>
        void AddVariableBinding(VariableBinding varBinding);

        /// <summary>
        /// Bind the task map
        /// </summary>
        void Bind();
        
    }
}
